ihelpuoo.widget.CLIENT_OFFSET_X = 0;
ihelpuoo.widget.MOUSE_OFFSET_X = 4;
ihelpuoo.widget.CLIENT_OFFSET_Y = 9;
ihelpuoo.widget.MOUSE_OFFSET_Y = 9;

ihelpuoo.widget.GC.getLeft = function(ele)
{
	if(!ele || ele==window || ele == document) return 0;
	if(ele == document.body) return 0;
	return ele.offsetLeft + ihelpuoo.widget.GC.getLeft(ele.offsetParent);
}

ihelpuoo.widget.GC.getTop = function(ele)
{
	if(!ele || ele==window || ele == document) return 0;
	if(ele == document.body) return 0;
	return ele.offsetTop + ihelpuoo.widget.GC.getTop(ele.offsetParent);
}

ihelpuoo.widget.GC.getRect = function(ele)
{
	var rect = new ihelpuoo.widget.Rect();
	ihelpuoo.widget.GC.countRect(ele,rect);
	return rect;
}

ihelpuoo.widget.GC.countRect = function(ele,rect)
{
	rect.top = ihelpuoo.widget.GC.getTop(ele);
	rect.left = ihelpuoo.widget.GC.getLeft(ele);
	rect.width = ele.offsetWidth;
	rect.height = ele.offsetHeight;
}

ihelpuoo.widget.GC.getSize = function(ele)
{
	var p = new ihelpuoo.widget.Point();
	ihelpuoo.widget.GC.countSize(ele,p);
	return p;
}

ihelpuoo.widget.GC.countSize = function(ele,p)
{
	p.x = ele.offsetWidth;
	p.y = ele.offsetHeight;
}

ihelpuoo.widget.GC.countBottomRight = function(rect2)
{
	rect2.bottom = rect2.top + rect2.height;
	rect2.right = rect2.left + rect2.width;
}

ihelpuoo.widget.GC.getMidpoint = function(ele)
{
	var p = new ihelpuoo.widget.Point();
	p.x = window.document.body.clientWidth/2;
	p.y = window.document.body.clientHeight/2
	return p;
}

ihelpuoo.widget.GC.moveToCentre = function(ele,pEle)
{
	var rect = ihelpuoo.widget.GC.getRect(ele);
	var pRect = ihelpuoo.widget.GC.getRect(pEle);
	var cp = ihelpuoo.widget.GC.getMidpoint(pEle);
	var np = new ihelpuoo.widget.Point();
	np.x = cp.x - rect.width/2 + pRect.left;
	np.y = cp.y - rect.height/2 + pRect.top;
	ele.style.position = "absolute";
	ele.style.left = np.x;
	ele.style.top = np.y;  
}

ihelpuoo.widget.GC.moveToLeftBottom = function(ele,pEle)
{
	var rect = ihelpuoo.widget.GC.getRect(ele);
	var pRect = ihelpuoo.widget.GC.getRect(pEle);
	var cp = ihelpuoo.widget.GC.getMidpoint(pEle);
	var np = new ihelpuoo.widget.Point();
	np.x = pRect.left;
	np.y = pRect.top + pRect.height - rect.height;
	ele.style.position = "absolute";
	ele.style.left = np.x;
	ele.style.top = np.y;  
}

ihelpuoo.widget.GC.moveToLeftTop = function(ele,pEle)
{
	var pRect = ihelpuoo.widget.GC.getRect(pEle);
	ele.style.position = "absolute";
	ele.style.left = pRect.left;
	ele.style.top = pRect.top;  
}